package model

import (
	"gitee.com/konyshe/gogo"
)

func GetConfigMap() (configMap map[string]map[string]interface{}) {
	queryData, err := gogo.SQLQueryByMap(
		"name",
		"",
		"config",
		"",
		"", 0, 100)

	if err != nil {
		gogo.LogError(err)
		return nil
	}

	configMap = queryData.(map[string]map[string]interface{})

	return
}

func GetVersionMap() (map[string]map[string]interface{}, error) {
	queryData, err := gogo.SQLQueryByMap(
		"name",
		"",
		"version",
		"",
		"", 0, 100)

	if err == nil {
		configMap := queryData.(map[string]map[string]interface{})
		return configMap, nil
	}

	return nil, err
}
